<p>
  <h1><%=h @resource.title %></h1>
  <% @userOfThisResource = (User.find(@resource.user_id)) %>
</p>

<p>
  <b>Added by:</b>
 <!-- <%=h @userOfThisResource.username %> -->
 	<% user = (User.find(@resource.user_id)) %>
  <%= link_to user.username , :action => 'show' , :controller => 'users' , :id => @userOfThisResource.id %> <br />
  <%= @resource.created_at.to_formatted_s(:short) %>
</p>

<p>
  <b>Description:</b>
  <%= render :partial => 'generalTemplates/resource_show' %>
</p>

<p>
  <b>Link:</b>
  <%= link_to @resource.link, @resource.link, :popup=>true %>
</p>
<div id="video">
	<%= render :partial => @resource.returnType , :local => @resource %>
</div>
		<div id = "tags">
			<b>Tags:</b>
    		<% tags = @resource.showResourceTags() %>
			<% for tag in tags %>
    		<%= link_to tag.name, :controller => "resources" , :action => "index" , :tag_id => tag.id %> |
		<% end %>
		</div> 

	
<div id="tagEdit">  
</div>  
 <%= render :partial => 'generalTemplates/add_tags_to_others_resources' %>

<%= link_to 'Back', resources_path %>
    	<%= render :partial => 'resources/edit_other_resources'  %>
    	<div id="add_remove_fav_"
    		<%= render :partial => 'generalTemplates/add_remove_favourites_from_precise_div'  %> 
    	</div>
<div id="filtered_resources">
</div>

		<div id="comment_<%= @resource.id.to_s %>">		
			<%= link_to_remote('Leave a comment', 
				:update=>"comment_"+@resource.id.to_s, 
				:url=>{:controller=>"comments", :action=>"show_comment_input", :res_id=>@resource.id},
				:success=>visual_effect(:slide_down, "comment_"+@resource.id.to_s)
				) %>
		</div>
		<div id="r_comment_<%= @resource.id.to_s %>">		
			<%= link_to_remote('Show comments', 
				:update=>"r_comment_"+@resource.id.to_s, 
				:url=>{:controller=>"comments", :action=>"show_comments_of", :res_id=>@resource.id},
				:success=>visual_effect(:slide_down, "r_comment_"+@resource.id.to_s)
				) %>
		</div>



 <%= link_to_remote "add note", :url => {:action => "new" , :controller => "notes" , :user_id => session[:user_id] , :resource_id => @resource.id},
 								:update => "add_note" %>
<%= link_to_remote "My notes", :url => {:action => "index" , :controller => "notes" , :user_id => session[:user_id] , :resource_id => @resource.id , :my_notes => "true" },
 								  :update => "view_note"   %>
 <%= link_to_remote "All visible notes", :url => {:action => "index" , :controller => "notes" , :user_id => session[:user_id] , :resource_id => @resource.id},
 								  :update => "view_note" %>
  <%= link_to "print notes", :action => "index" , :controller => "notes" , :user_id => session[:user_id] , :resource_id => @resource.id , :pretty_print_notes => 'true' %>
 <div id="add_note">
 <div>
  <div id="view_note">
 <div>